package com.luguangtao.controller;

import com.luguangtao.api.HystrixApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @类名: com.luguangtao.controller
 * @作者: lgt
 * @创建时间: 2019-12-05 08:59
 * @描述:
 **/
@RestController
public class HyController2 {
    @Autowired
    HystrixApi hystrixApi;

    @RequestMapping("test002")
    public String test002(){
        String s = hystrixApi.test001();
        if(s.equals("aa")){
            return "成功~~~";
        }else if (s.equals("xx")){
            return "熔断检测----->出错啦";
        }
        return s;
    }
}
